package com.huawei.gamebox.service.common.cardkit.node;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import com.huawei.gamebox.service.common.cardkit.card.HorizonBaseCard;
import o.azb;
import o.chz;
import o.exp.d;
import o.exp.j;

public abstract class HorizonBaseNode extends BaseGsNode {
    private HorizonBaseCard ˊ = null;

    public abstract HorizonBaseCard ˎ();

    public HorizonBaseNode(Context context) {
        super(context);
    }

    public int ˏ() {
        return 1;
    }

    public boolean ॱ() {
        return true;
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
        layoutParams.weight = 1.0f;
        LayoutInflater from = LayoutInflater.from(this.ॱ);
        this.ˊ = ˎ();
        View view = (LinearLayout) from.inflate(j.ᐨ, null);
        ˏ(view);
        this.ˊ.ॱ(view);
        ˊ(this.ˊ);
        viewGroup.addView(view, layoutParams);
        return true;
    }

    private void ˏ(LinearLayout linearLayout) {
        azb.ˏ(linearLayout, d.ˎ);
    }

    public boolean ॱ(chz o_chz, ViewGroup viewGroup) {
        if (this.ˊ != null) {
            this.ˊ.ˊ(o_chz.ʻ());
        }
        return super.ॱ(o_chz, viewGroup);
    }
}
